<template>
  <div class="box">
    <ul>
      <li @click="go(item.id)" v-for="item in list" :key="item.id">{{
          item.task
      }}</li>
    </ul>
  </div>
</template>

<script setup lang="ts">
import { useStore } from 'vuex'
import { computed } from 'vue'
import { useRouter } from 'vue-router'
import { IListItem } from '@/store/index'
let store = useStore()
let router = useRouter();
let list: IListItem[] = store.state.list;
const go = (id: string | number) => {
  router.push('/detail?id=' + id)
}
</script>

<style lang="less" scoped>
.box {
  width: 600px;
  margin: auto;
  box-shadow: 1px 1px 1px 1px #ccc
}
</style>